package com.struct.graph.game
{
	import com.component.ComponentChildren;
	import com.utils.Utils;
	
	import flash.text.TextFieldAutoSize;
	
	public class AbilityBox extends ComponentChildren
	{
		public var d:Object;
		public function AbilityBox(d:Object)
		{
			super();
			this.d = d;
			buttonMode = true;
			width = 65;
			height = 50;
			Utils.createTextField(this,0, 15, d.name, 14, 0xff0000, true, TextFieldAutoSize.CENTER, width);
			setSelected(false);
		}
		
		public function setSelected(f:Boolean):void{
			graphics.clear();
			graphics.beginFill(0x0);
			graphics.drawRect(0, 0, width, height);
			if(f){
				graphics.beginFill(0xffffff);
				graphics.drawRect(3, 3, width - 6, height - 6);
			}
			graphics.endFill();
		}
	}
}